package org.example.page;

import lombok.extern.log4j.Log4j2;
import org.example.param.Parameter;
import org.example.param.ResourceLoad;
import org.example.param.WindowsParam;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.InputStream;
@Log4j2
public class WindowsErrPanel extends JPanel {
    private Dimension screenSize;
    private BufferedImage windowsUpdateImage;


    public WindowsErrPanel() {

        panelInit();

    }


    private void panelInit() {
        //获取屏幕大小
        screenSize = WindowsParam.getScreenSize();



    }


    public void showWindowsUpdatePage() {

        //读取windows_err.jpg
        windowsUpdateImage = ResourceLoad.getWindowsUpdateImage();
        //创建JFrame
        JFrame fillWindowsFrame = new JFrame();
        fillWindowsFrame.setSize(screenSize);
        fillWindowsFrame.setUndecorated(true);

        fillWindowsFrame.add(this);
        //处理页面切换事件
//        manageKey();
        //显示窗口
        fillWindowsFrame.setVisible(true);
    }



    @Override
    public void paint(Graphics g) {
        g.drawImage(windowsUpdateImage,0,0,null);
    }
}
